package com.xbongbong.pro.message.service;

import com.alibaba.dingtalk.openapi.newmessage.entity.AbstractMessage;
import com.alibaba.dingtalk.openapi.newmessage.entity.Msg;
import com.alibaba.dingtalk.openapi.newmessage.entity.template.TemplateMessage;
import com.alibaba.dingtalk.openapi.newmessage.helper.CorpConversationHelper;
import com.alibaba.dingtalk.openapi.newmessage.helper.SendToConversationHelper;
import com.xbongbong.paas.toolbox.exception.XbbException;

/**
 * 消息推送 走钉钉新接口
 * @author 魏荣杰
 * @date 2019/3/22 15:28
 * @since v1.0
 * @version v1.0
 */
public interface MessageNewService {
    /**
     * Description: 发送钉钉oa消息给用户,部门，默认不发给企业全部用户
     * @param corpid 公司id
     * @param message 消息体
     * @param userIdList 推送人员 接收者的用户userid列表，最大列表长度：100, 例如：3541561,454564  中间用英文逗号隔开
     * @param depIdList 推送部门 接收者的部门id列表，最大列表长度：20,  接收者是部门id下(包括子部门下)的所有用户   例如：3541561,454564  中间用英文逗号隔开
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/22 15:34
     * @since v1.0
     */
    CorpConversationHelper.SendResponse dingtalkOAMessagePushToUserAndDept(String corpid, AbstractMessage message, String userIdList, String depIdList) throws XbbException;

    /**
     * Description: 查询工作通知消息的发送进度
     * @param corpid 公司id
     * @param taskId 消息任务id
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/22 19:33
     * @since v1.0
     */
    CorpConversationHelper.ProgressResponse dingtalkOAMessagePushProgress(String corpid, Long taskId) throws XbbException;

    /**
     * Description: 查询工作通知消息的发送结果
     * @param corpid 公司id
     * @param taskId 消息任务id
     * @return void
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/22 19:37
     * @since v1.0
     */
    CorpConversationHelper.SendResultResponse dingtalkOAMessagePushSendResult(String corpid, Long taskId) throws XbbException;

    /**
     * Description: 发送普通消息
     * @param corpid 公司id
     * @param userIdList 推送人员
     * @param cid 群会话或者个人会话的id
     * @param msg 消息内容
     * @return com.alibaba.dingtalk.openapi.newmessage.helper.SendToConversationHelper.SendToConversationResponse
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/5/20 15:30
     * @since v1.0
     */
    SendToConversationHelper.SendToConversationResponse dingtalkSendToConversation(String corpid, String userIdList, String cid, Msg msg) throws XbbException;
    

    /**
     * Description: 通过模板发送工作通知
     * @param corpid
	 * @param templateMessage
     * @param userIdList
     * @param depIdList
* @return com.alibaba.dingtalk.openapi.newmessage.helper.CorpConversationHelper.SendByTemplateResponse
     * @throws 
     * @author 魏荣杰
     * @date 2021/12/2 15:44
     * @since
     */
    CorpConversationHelper.SendByTemplateResponse dingtalkWorkMessageByTemplatePushToUserAndDept(String corpid, TemplateMessage templateMessage, String userIdList, String depIdList) throws XbbException;
}
